<template>
  <div class="accountInfo">
    <div class="account">
      <div class="account_title">管理制度</div>
    </div>
    <div>
      <a-table :columns="columns" :data-source="data" @change="onChange">
        <div
          class="textSelect"
          slot="voucher"
          slot-scope="text"
          @click="pdfView"
        >
          <span>{{ text }}</span>
        </div>
      </a-table>
    </div>
     <!-- 查看pdf -->
    <a-modal
      v-model="visible"
      title
      @ok="handleOk"
      :footer="null"
      :maskClosable="false"
    >
      <embed
        width="1000"
        height="700"
        src="http://it-jhkj.zhinengjianshe.com/uploadfile/temp/device/2cd6a578de5d447cbcc70fd857b3b31c/2cd6a578de5d447cbcc70fd857b3b31c.pdf"
        type
      />
    </a-modal>
  </div>
</template>

<script>
export default {
  data() {
    return {
      columns: [
        {
          title: "名称",
          dataIndex: "name",
          align: "center",
        },
        {
          title: "上传时间",
          dataIndex: "date",
          align: "center",
        },
        {
          title: "附件",
          dataIndex: "enclosure",
          align: "center",
          key: "voucher",
          scopedSlots: { customRender: "voucher" },
        },
      ],
      data: [
        {
          key: "1",
          name: "紧急保障措施",
          date: "2021-2-21",
          enclosure: "总承包单位紧急保障措施.pdf",
        },
        {
          key: "2",
          name: "保障农民工工资支付制度",
          date: "2021-2-21",
          enclosure: "保障农民工工资支付制度.pdf",
        },
      ],
       visible :false
    };
  },
  methods: {
    onChange(pagination, filters, sorter) {
      console.log("params", pagination, filters, sorter);
    },
     pdfView() {
      this.visible = true;
    },
    handleOk(e) {
      //   console.log(e);
      this.visible = false;
    }
  },
};
</script>

<style scoped>
::v-deep .ant-table-pagination.ant-pagination {
  display: none;
}
.account {
  height: 45px;
  /* border-bottom: 1px solid #ccc; */
  margin-bottom: 30px;
}
.account_title {
  width: 90px;
  height: 45px;
  font-size: 16px;
  line-height: 45px;
  color: #1890ff;
  border-bottom: 2px solid #1890ff;
  text-align: center;
  margin-left: 30px;
}
::v-deep .ant-modal {
  width: 1080px !important;
  top:10px
}
::v-deep .ant-modal-body {
  padding: 40px;
  height: 780px;
}
</style>
